<script src="<?php echo base_url('static/javascript/xiuxiu.js');?>"></script>
<script type="text/javascript">
window.onload=function(){
  /*第1个参数是加载编辑器div容器，第2个参数是编辑器类型，第3个参数是div容器宽，第4个参数是div容器高*/
  xiuxiu.embedSWF("altContent",5,"100%","100%");
  //修改为您自己的图片上传接口
  xiuxiu.setUploadURL("<?php echo base_url('ucenter/uploadHeadimg');?>");
  xiuxiu.setUploadType(2);
  xiuxiu.setUploadDataFieldName("Filedata");
  xiuxiu.onInit = function ()
  {
    xiuxiu.loadPhoto("");//修改为要处理的图片url
  }
  xiuxiu.onUploadResponse = function (data)
  {
	  $("#userHeadimg").attr('src',$("#baseUrl").val()+data);
	  $("#modifyHeadimg").modal('hide');
  }
}
</script>



<div class="wrapper clearfix">

	<?php $this->load->view('ucenter/sidebar');?>
	
	<div class="content">
		
		<div class="header">
			<h3>当前头像</h3>
			<img id="userHeadimg" src="<?php echo $user_info['0']->head_pic?base_url('uploads/headimg/region/'.$user_info['0']->head_pic):base_url("static/images/avatar/big.jpg");?>" />
			<a href="Javascript:;" onclick="showHeadimg()"  class="btn btn-primary">更换头像</a>
		</div>
		
	
		
	
	</div>

</div>

<!-- Button trigger modal -->

<script>
function showHeadimg(){
	$("#modifyHeadimg").modal('show');
}
</script>

<!-- Modal -->
<div class="modal fade" id="modifyHeadimg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">更换头像</h4>
      </div>
      <div class="modal-body">
        <div id="altContent">
			<h1>美图秀秀</h1>
		</div>
      </div>
    </div>
  </div>
</div>



